package com.city.justlisten.service.impl;

import com.city.justlisten.entity.Singer;
import com.city.justlisten.mapper.SingerMapper;
import com.city.justlisten.service.SingerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Cheng
 * Date: 2021/1/28
 * Time: 22:26
 * Description: No Description
 */
@Service
public class SingerServiceImpl implements SingerService {

    @Autowired
    private SingerMapper singerMapper;

    @Override
    public Boolean addSinger(Singer singer) {
        return singerMapper.addSinger(singer)>0;
    }

    @Override
    public Boolean deleteSinger(Integer id) {
        return singerMapper.deleteSinger(id)>0;
    }

    @Override
    public List<Singer> selectByNameSinger(String name) {
        List<Singer> singers = singerMapper.selectByNameSinger(name);
        return singers;
    }

    @Override
    public List<Singer> selectByPaginationSinger(Integer page, Integer limit) {
        return singerMapper.selectByPaginationSinger(page,limit);
    }

    @Override
    public List<Singer> selectBySexSinger(Integer sex) {
        return singerMapper.selectBySexSinger(sex);
    }

    @Override
    public Singer selectOneSinger(Integer id) {
        return singerMapper.selectOneSinger(id);
    }

    @Override
    public List<Singer> selectSinger() {
        return singerMapper.selectSinger();
    }

    @Override
    public Boolean updateSinger(Singer singer) {
        return singerMapper.updateSinger(singer)>0;
    }
}
